#ifndef __PROPERTY_DATA_H__
#define __PROPERTY_DATA_H__

#include "stdbool.h"
#include "string.h"
#include "stdlib.h"

typedef struct _data_boolean
{
    bool value;
} data_boolean_t;


typedef struct _data_string
{
    char          value[800];
    unsigned int  length;
} data_string_t;

typedef enum _data_number_type
{
    DATA_NUMBER_INTEGER  = 0,
    DATA_NUMBER_FLOAT    = 1,
	DATA_NUMBER_DOUBLE_FLOAT    = 2,
} data_number_type_t;

typedef struct _data_number_value
{
    int    integerValue;
    float   floatValue;
} data_number_value_t;

typedef struct _data_number
{
    data_number_type_t      type;
    data_number_value_t     value;
} data_number_t;

typedef union _property_data
{
    data_boolean_t     boolean;
    data_string_t      string;
    data_number_t      number;
} property_data_t;


typedef enum _property_format
{
    PROPERTY_FORMAT_UNDEFINED      = 0,
    PROPERTY_FORMAT_BOOLEAN        = 1,
    PROPERTY_FORMAT_STRING         = 2,
    PROPERTY_FORMAT_NUMBER         = 3,
} property_format_t;

typedef struct _property_value
{
    property_format_t   format;
    property_data_t     data;
} property_value_t;

typedef struct _miio_property_operation
{
    unsigned int      siid;
    unsigned int      piid;
    int               code;
    property_value_t  value;
} property_operation_t;


typedef struct _argument
{
    unsigned int            piid;
    property_value_t        value;
} argument_t;

typedef struct _arguments
{
    int           size;
    argument_t    arguments[5];
} arguments_t;

typedef struct _miio_action_operation
{
    unsigned int      siid;
	unsigned int      aiid;
    int               code;
} action_operation_t;



#endif /* __PROPERTY_DATA_H__ */
